#pragma once

#include "Types.h"

namespace Vortex { namespace Wrapper { namespace Direct3D {

	ref class Direct3DDevice9;
	ref class Direct3DSurface9;

	///<summary>Wrapper of IDirect3DSwapChain9 interface</summary>
	public ref class Direct3DSwapChain9 {
		IDirect3DSwapChain9* _handle;

	public:

		///<summary>Direct3DDevice handle</summary>
		property IntPtr Handle { IntPtr get() { return IntPtr(_handle); } }

		Direct3DSwapChain9(IDirect3DSwapChain9* handle);

		~Direct3DSwapChain9();

		///<summary>Presents swap chain frame content</summary>
		HResult Present(Nullable<System::Drawing::Rectangle> sourceRect, Nullable<System::Drawing::Rectangle> destRect, IntPtr destWindowOverride);

		///<summary>Retrieves backbuffer with specified index</summary>
		HResult GetBackBuffer(UINT BackBuffer, [Out] Direct3DSurface9^% result);

	};
}}}